<template>
  <div>
    <slot></slot>
    <el-button icon="el-icon-search" type="primary" @click="handleSearch()">查询</el-button>
  </div>
</template>

<script>
  export default {
    name: "zi",
    data() {
      return {

      }
    },
    methods: {
      handleSearch(){
        // this.$parent.$refs.
        console.log(this.$slots)
        console.log(this.$slots.default[0].child)
        console.log(this.$parent.$refs.ruleForm)
        // this.$slots.default[0].child.validate((valid) => {
        this.$parent.$refs.ruleForm.validate((valid) => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      }
    }
  }
</script>

<style scoped>

</style>
